package com.moyq5.mvc.maker.test.bean.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
import org.hibernate.annotations.TypeDefs;

import com.moyq5.mvc.maker.test.bean.IotBrandDeviceAlarmRuleUserType;
import com.moyq5.mvc.maker.test.bean.IotBrandDeviceCmdRuleUserType;
import com.moyq5.mvc.maker.test.bean.IotBrandDeviceStateRuleUserType;
import com.moyq5.mvc.maker.test.bean.IotBrandDeviceTcpRuleUserType;
import com.moyq5.mvc.maker.test.bean.custom.IotBrandDeviceAlarmRule;
import com.moyq5.mvc.maker.test.bean.custom.IotBrandDeviceCmdRule;
import com.moyq5.mvc.maker.test.bean.custom.IotBrandDeviceStateRule;
import com.moyq5.mvc.maker.test.bean.custom.IotBrandDeviceTcpRule;


/**
 * 终端品牌，每个终端设备归一个品牌，品牌确定终端具有哪些通讯能力（协议）、指令类型、告警类型等。
 * @author Moyq5
 * @date 2018年8月28日
 */
@TypeDefs({
	@TypeDef(name = "tcp", typeClass = IotBrandDeviceTcpRuleUserType.class),
	@TypeDef(name = "state", typeClass = IotBrandDeviceStateRuleUserType.class),
	@TypeDef(name = "cmd", typeClass = IotBrandDeviceCmdRuleUserType.class),
	@TypeDef(name = "alarm", typeClass = IotBrandDeviceAlarmRuleUserType.class)
})
@Entity
@Table(name = "iot_brand")
@DynamicUpdate
public class IotBrand implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	/**
	 * 品牌ID
	 */
	@Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "native")@GenericGenerator(name = "native", strategy = "native")
    @Column(name = "brand_id")
	private Long brandId;
	/**
     * 品牌名称
     */
    @Column(name = "name", nullable = false, length = 32)
    private String name;
    
    /**
     * 数据协议支持
     */
    @Type(type = "tcp")
    @Column(name = "tcp", length = 1000)
    private IotBrandDeviceTcpRule tcp;
    
    /**
     * 定制状态
     */
    @Type(type = "state")
    @Column(name = "state", length = 1000)
    private IotBrandDeviceStateRule state;
    
    /**
     * 定制指令
     */
    @Type(type = "cmd")
    @Column(name = "cmd", length = 1000)
    private IotBrandDeviceCmdRule cmd;
    
    /**
     * 定制告警
     */
    @Type(type = "alarm")
    @Column(name = "alarm", length = 1000)
    private IotBrandDeviceAlarmRule alarm;


	public Long getBrandId() {
		return brandId;
	}

	public void setBrandId(Long brandId) {
		this.brandId = brandId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public IotBrandDeviceTcpRule getTcp() {
		return tcp;
	}

	public void setTcp(IotBrandDeviceTcpRule tcp) {
		this.tcp = tcp;
	}

	public IotBrandDeviceStateRule getState() {
		return state;
	}

	public void setState(IotBrandDeviceStateRule state) {
		this.state = state;
	}

	public IotBrandDeviceCmdRule getCmd() {
		return cmd;
	}

	public void setCmd(IotBrandDeviceCmdRule cmd) {
		this.cmd = cmd;
	}

	public IotBrandDeviceAlarmRule getAlarm() {
		return alarm;
	}

	public void setAlarm(IotBrandDeviceAlarmRule alarm) {
		this.alarm = alarm;
	}
	
}
